
def avg(a_list):
    '''This function finds the average val in a list.'''
    x = (sum(a_list) / len(a_list))
    print('The average is:',x)
    return x


def new_func(a_list):
    return (sum(a_list) / len(a_list))

old_avg = avg
avg = new_func

# old_avg([4,6])  # 此时调用的是第一个函数

def func_info(func):
    '''
    元函数，输出了传递给它的函数信息
    重新指定了函数名之后 它会追溯到之前的函数
    '''
    print('Function name:',func.__name__)   # 传参 old_avg时，输出 Function name: avg
    print('Function documentation:')
    help(func)

func_info(old_avg)
